<script>
	export default {
		onLaunch: function() {
			console.log('App Launch')
		
			let self = this
			uni.onNetworkStatusChange(function(res) {
				if (getApp().globalData.isConnected == res.isConnected)
					return
		
				getApp().globalData.isConnected = res.isConnected
				console.log(res.isConnected); //当前是否有网络连接
				console.log(res.networkType); //网络类型
				if (res.isConnected === false) {
					uni.showToast({
						title: "网络已断开,请检查",
						icon: 'none',
						duration: 2000,
					})
				} else {
					uni.showToast({
						title: "网络已连接",
						icon: 'none',
						duration: 2000,
					})
				}
			})
			uni.onTabBarMidButtonTap(function(e) {
				self.wxScanCode()
			})
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		},
		globalData: {
			test: '',
			//小程序
			base_url: 'https://www.hperfor.com/homeschool',
			base_token: '',
			base_user: null,
			base_wx_user: {},
			system_info: null,
			isConnected: true,
		},
	}
</script>

<style>
	/*每个页面公共css */
</style>
